package com.huaixia18.systemnotice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huaixia18.systemnotice.domain.PrivateChat;
import org.springframework.stereotype.Repository;

@Repository
public interface PrivateChatMapper extends BaseMapper<PrivateChat> {

    // 根据user1Id和user2Id查询聊天室
    PrivateChat findByUser1IdAndUser2Id(Long user1Id, Long user2Id);

    // 根据user2Id和user1Id查询聊天室（因为user1Id和user2Id无特定先后顺序）
    PrivateChat findByUser2IdAndUser1Id(Long user2Id, Long user1Id);

}
